package com.campus.counseling.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

/**
 * 结果解释实体类
 */
@Data
@TableName("result_interpretations")
public class ResultInterpretation {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("test_id")
    private Long testId;
    
    private String dimension;
    
    @TableField("min_score")
    private Double minScore;
    
    @TableField("max_score")
    private Double maxScore;
    
    private String level;
    
    private String interpretation;
    
    private String suggestions;
    
    private String references;
    
    /**
     * 状态：0-禁用，1-启用
     */
    private Integer status;
    
    @TableField("create_time")
    private LocalDateTime createTime;
    
    @TableField("update_time")
    private LocalDateTime updateTime;
    
    @TableField(exist = false)
    private List<Double> scoreRange;

    public void setScoreRange(List<Double> scoreRange) {
        if (scoreRange != null && scoreRange.size() >= 2) {
            this.minScore = scoreRange.get(0);
            this.maxScore = scoreRange.get(1);
        }
    }

    public List<Double> getScoreRange() {
        return Arrays.asList(minScore, maxScore);
    }
} 